class CreatePermissionsWorkordertypes < ActiveRecord::Migration
  def self.up
    create_table :permissions_workordertypes, :id => false do |t|
        t.references :permission
        t.references :workordertype
    end
    add_index :permissions_workordertypes, [:permission_id, :workordertype_id], :name => 'perms_wots_index'
    add_index :permissions_workordertypes, [:workordertype_id, :permission_id] , :name => 'wots_perms_index' 
  end

  def self.down
    drop_table :permissions_workordertypes
  end

end
